The technology described herein relates to the processing of computer graphics and in particular to a method of and an apparatus for generating a set of polygon vertices for a region of a three-dimensional object.
It is common in computer graphics systems to render three-dimensional objects for display by sub-dividing the surface of each three-dimensional object into a number of similar basic components (so-called “primitives”) to allow the graphics processing operations to be more easily carried out. These “primitives” are usually in the form of simple polygons, such as triangles and quadrilaterals.
The graphics primitives are usually generated by the applications program interface for the graphics processing system, using the graphics drawing instructions (requests) received from the application (e.g. game) that requires the graphics output.
Each primitive at this stage is usually defined by and represented as a set of vertices. Each vertex for a primitive has associated with it a set of data (such as position, colour, texture and other attributes data) representing the vertex. This data is then used, for example, when rasterising and rendering the vertex (the primitive(s) to which the vertex relates) in order to generate the desired output of the graphics processing system.
Once primitives and their vertices have been generated and defined, they can be processed by the graphics processing system, in order, for example, to display the object that they relate to.
One way to display the surface geometry of a three-dimensional object more accurately and therefore realistically is to increase the number of primitives and vertices used to represent the object. However, sometimes this additional information may not be needed, for example if the object is being viewed from far away or its surface is at a shallow angle to the viewer, such that finer detail in the surface geometry will not be visible in the rendered output, even if it is generated (rendered). In such circumstances, it is a waste of processing resources to process a large number of primitives representing the finer detail of the object.
It is known therefore to represent the surface geometry of objects with larger “patches”, and then to tessellate additional vertices (primitives) within a patch if required in order to display a finer level of detail on the object. However, when additional vertices are tessellated they do not necessarily contain all the information regarding their position to create an accurate representation of the surface relief of the object. For example, the positions of the additional vertices could be interpolated across the patch using the limited number of vertices used to define the patch, e.g. at the corners of the patch. This works if the surface relief of the patch is flat but will not provide an accurate representation of the surface relief of the object if the patch is anything apart from flat.
An efficient way of providing the surface relief to the patch in this circumstance is to separate out, from the three-dimensional object described by the primitives and vertices within the patch, the finer details of the surface geometry into a so-called “displacement map”. The displacement map contains the differences in surface relief between the primitives and the actual object to be displayed. The vertices for the patch are then “displaced” using the displacement map (e.g. by sampling the displacement map at the vertex positions) to provide the surface detail of the object being rendered across the surface of the patch.
In these arrangements, the level of tessellation of the patches representing the basic surface geometry of the object determines in how much detail the displacement map is sampled within each patch. If the level of tessellation is low, i.e. the sampling is coarse, then all the surface relief features in the displacement map will not be displayed in the output, rendered object, particularly when there is a lot of detail in the displacement map, i.e. the displacement map includes high frequency components. This can then cause a problem if, in a subsequent frame, a higher level of tessellation is used (e.g. because the object is closer to the viewer), as that will result in finer detailed sampling of the displacement map and so can result in the viewer seeing the sudden appearance of surface relief detail (or vice-versa when moving from a higher level of tessellation to a lower level of tessellation, e.g. as an object moves away from the viewer). This undesirable effect is known as “popping”.
In order to reduce “popping” effects, patches are typically tessellated to a greater degree than may otherwise be necessary (“over-tessellated”). However, while this can reduce the risk of “popping”, it results in more primitives and vertices needing to be processed.
The Applicants believe therefore that there remains scope for improved techniques for the use of displacement maps within graphics processing systems, particularly for use in mobile and lower-powered environments where processing capability and bandwidth are limited.